﻿using Grow.Module.Options;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;

namespace Grow.AspNetCore.Options
{
    public class OptionsBind : IOptionsBind
    {
        private readonly IConfiguration _configuration;

        public OptionsBind(IConfiguration configuration)
        {
            _configuration = configuration;
        }


        public void Bing<TOptions>(string key, TOptions options) where TOptions : class, IOptions
        {
            _configuration.Bind(key, options);
        }
    }
}
